﻿#pragma strict

var doorPoint : Transform;
var windowPoint : Transform;

var cornerL : GameObject;
var cornerR : GameObject;
var middle : GameObject;
var start : GameObject;
private var roomInstance : GameObject;

function setType(type : String){

	switch(type){
		case "cornerL":
			roomInstance = Instantiate(cornerL, transform.position, transform.rotation);
			roomInstance.transform.parent = transform;
			break;
		case "cornerR":
			roomInstance = Instantiate(cornerR, transform.position, transform.rotation);
			roomInstance.transform.parent = transform;
			break;
		case "middle":
			roomInstance = Instantiate(middle, transform.position, transform.rotation);
			roomInstance.transform.parent = transform;
			break;
		case "start":
			roomInstance = Instantiate(start, transform.position, transform.rotation);
			roomInstance.transform.parent = transform;
			break;
		}
}

